<template>
  <div>

  </div>
</template>

<script>
  export default {
    name: "ScanTemp",
    data() {
      return {
        userInfo: {
          kindergartenId: '',
          openId: '',
        }
      }
    },
    methods: {
      fetchKinsfolkStatus() {
        this.$http.fetchKinsfolkStatus(this.userInfo).then(resp => {
          this.$toast.hide();
          let data = resp.data;
          this.$Cookies.set("token", data.token);
          this.$Cookies.set("fullName", data.fullName);
          this.$Cookies.set("loginType", data.loginType);
          this.$Cookies.set("headImage", data.headImage);
          this.$Cookies.set("custom", data.custom);
          this.$router.push("/home");
        }).catch(e=>
        {
          this.$router.push("/index?selectType=kinsfolk");
          return
          // this.$toast.show('你未注册。请从公众号左下角 点击菜单 微幼云，我是家长 进行绑定', 'loading');
        })
      }
    },
    created() {
      this.$toast.show('加载中...', 'loading');
      this.userInfo = this.$route.query
    },
    mounted() {
      this.fetchKinsfolkStatus();
    }
  }
</script>

<style scoped>

</style>
